<?php
declare (strict_types = 1);

namespace app\store\controller;

use app\store\model\AppointmentSetting as AppointmentSettingModel;

class AppointmentSetting extends Controller
{
    public function info()
    {
      $setting = AppointmentSettingModel::get(['key' => 'appointment']);
      return $this->renderSuccess(compact('setting'));
    }

    public function update()
    {
      $model = AppointmentSettingModel::get(['key' => 'appointment']);
      if($model->updateInfo($this->postForm())) {
        return $this->renderSuccess('更新成功');
      }

      return $this->renderError('更新失败');
    }
}
